let fs=require('fs')
let path=require('path')
let express=require('express')

let app=express();

let data=fs.readFileSync(path.join(__dirname, './goods.json'),'utf-8')
app.use(express.static(path.join(__dirname,"./public")))
app.use(express.json)
// 回首页
// app.get('/',(req,res)=>{
//     res.end(fs.readFileSync(path.join(__dirname,"./public/inedx.html"),'utf-8'))
// })
app.get('/goods',(req,res)=>{
    res.sendFile(path.join(__dirname, './goods.json'))
})
// 创建端口号
app.listen(8080)